

/**
 *
 * @param {初始化着色器} gl
 * @param {*} vertexShaderSource
 * @param {*} fragmentShaderSource
 */
function initShaders(gl, vertexShaderSource, fragmentShaderSource) {
  const vertexShader = gl.createShader(gl.VERTEX_SHADER)
     const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER)
     gl.shaderSource(vertexShader, vertexShaderSource)
     gl.shaderSource(fragmentShader, fragmentShaderSource)
     gl.compileShader(vertexShader)
     gl.compileShader(fragmentShader)

     const program = gl.createProgram()
      gl.attachShader(program, vertexShader)
      gl.attachShader(program, fragmentShader)

      gl.linkProgram(program)
      gl.useProgram(program)
      return program
}


/**
 * 数据归一化
 * @constructor
 */
function Normalization(minValue, maxValue, currentValue) {
    return (currentValue - minValue) / (maxValue - minValue)
}


